-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CIAINFRA-282: Cluster V1 CR: add observedGeneration and OperatorQuiescent #201
Conversation
225ac04
to
7283cbd
Compare
02266eb
to
3c150f3
Compare
bc59e08
to
59d1514
Compare
@@ -5,6 +5,8 @@ metadata: | |||
status: | |||
restarting: false | |||
conditions: | |||
- type: OperatorQuiescent | |||
status: "False" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this case is false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgrade is in progress (spec.version != status.version)
59d1514
to
6fcced5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but please let's wait for @chrisseto to have a chance to review.
b864472
to
26f0806
Compare
26f0806
to
c7186a1
Compare
Will switch tomorrow to a different strategy to fix the tests. Instead, i will remove the conditions from the assertion yamls, and add these:
|
8847960
to
0a499e4
Compare
Got a full green run locally, but CI so far flakes.
|
1911401
to
0fa3045
Compare
Name: observedCluster.Name, | ||
} | ||
cluster := &vectorizedv1alpha1.Cluster{} | ||
err := c.Get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For performing a patch request, I don't think you'd need to bother refreshing the cluster here. You just trying to push the changes performed by mutator
up to the server and Patch
doesn't return errors on ResourceVersion mismatches.
clusterPatch := client.MergeFrom(cluster.DeepCopy()) | ||
mutator(cluster) | ||
|
||
err = c.Status().Patch(ctx, cluster, clusterPatch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: prefer inline error handling to avoid polluting the name err
when possible. It also helps readers understand that err
is only considered within the scope of the if
and isn't intended to live further.
Sorry for the delay! Those kuttl assertion were a pain. Thanks for fixing/updating all of them! |
It is currently challenging to determine if a resource has been reconciled, and it is "ready": - No observedGeneration is exported in status. This makes it hard to determine, if the controller has already reconciled the cluster. Having observedGeneration in status, clients can just store the returned metadata.generation from the Update call, and wait until status.observedGeneration >= that value. - No field represents the controller having "done its work". The ClusterQuiescent condition represents this. If no outstanding work is known (business logic), and no errors are thrown, True is reported. Otherwise, false is reported.
0fa3045
to
560992b
Compare
The strategic merge patch should help in integration tests flakiness as many nighlty tests are failing with the following log: ``` Operation cannot be fulfilled on clusters.redpanda.vectorized.io \"central-removal\": the object has been modified; please apply your changes to the latest version and try again ``` That problem could happen due to addition of `Quiescent` condition in #201
The strategic merge patch should help in integration tests flakiness as many nighlty tests are failing with the following log: ``` Operation cannot be fulfilled on clusters.redpanda.vectorized.io \"central-removal\": the object has been modified; please apply your changes to the latest version and try again ``` That problem could happen due to addition of `Quiescent` condition in #201
The strategic merge patch should help in integration tests flakiness as many nighlty tests are failing with the following log: ``` Operation cannot be fulfilled on clusters.redpanda.vectorized.io \"central-removal\": the object has been modified; please apply your changes to the latest version and try again ``` That problem could happen due to addition of `Quiescent` condition in #201
It is currently challenging to determine if a resource has been reconciled, and it is "ready":